import {createRouter,createWebHistory} from "vue-router";


// 如何得到路由实例 createRouter()
// 如何设置路由模式 history
// history 模式 createWebHistory()
// hash 模式 createWebHashHistory()
const router = createRouter({
  // history: createWebHistory(import.meta.env.BASE_URL),
  // 默认参数 '/' 路由的基础路由
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
      {
      path: '/index',
        name: 'index',
      component: () => import('../views/index.vue')
    },
{
      path: '/',
      name: 'home',
      component: () => import('../views/Home.vue')
    },
      {path: '/login',
      name: 'login',
      component: () => import('../views/Login.vue')},
    {path:'/role',
      name:'role',
      component: () => import('../views/Roles.vue')},
      {
          path:'/addpro',
          name:'addpro',
          component: () => import('../views/Pro/Addpro.vue')
      },
      {
          path:'/task',
          name:'task',
          component: () => import('../views/Pro/Task.vue')
      },
      {
          path:'/load',
          name:'load',
          component: () => import('../views/Load/Loads.vue')
      }
  ]
})



export default router
